<?php
header("Content-Type:text/xml");
echo'<?xml version="1.0" encoding="utf-8" standalone="yes" ?>';
echo '<response>';
require_once("includes/include.php");
class financesearch extends daobase {
	 public function do_Financesearch($startdate,$enddate,$usernumber,$searchfx,$searchkind){
		if($searchfx == "all"){
		$searchfx = "%";	
		}
		if($searchfx == ""){
		$searchfx = "%";
		}
		if($searchkind == "all"){
		$searchkind ="%";
		}
		if($searchkind ==""){
		$searchkind ="%";
		} 
	 	$sql = "select * from finance where user_number = '$usernumber' and fx like '$searchfx' and kind like '$searchkind' and time between '$startdate' and '$enddate' order by fx,time";
		//echo $sql;
	 	$result = $this->fetchit($sql);
	 	return $result;
	 }
}
$startdate = $_POST["startdate"];
$enddate = $_POST["enddate"];
$searchfx = $_POST["searchfx"];
$searchkind =$_POST["searchkind"];
//echo $enddate;
@session_start();
$usernumber = $_SESSION["userNumber"];
$addFinanceTerm = new financesearch();
$response = $addFinanceTerm->do_Financesearch($startdate,$enddate,$usernumber,$searchfx,$searchkind);
foreach ($response as $values){
	echo "<item><fx>$values[fx]</fx><kind>$values[kind]</kind><title>$values[title]</title><quantity>$values[quantity]</quantity><beizhu>$values[beizhu]</beizhu><time>$values[time]</time></item>";
	
}
echo '</response>';
?>
